package com.hly.girl.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("redis")
public class RedisController {
	
	@Autowired
	private StringRedisTemplate strRedis;
	
	@RequestMapping("/test")
	public String test() {
		
		strRedis.opsForValue().set("cache", "hello ~~~~~");

		return strRedis.opsForValue().get("cache");
	}

}